home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / mac / media / dirs / BackUp / code.cst / 00005_Script_sound cues < prev    next >
Text File  |  2002-10-15  |  2KB  |  85 lines

  1. property events,times,snd,next_time,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,list_source,last_time,etime,ttime
  2.  
  3. on getpropertydescriptionlist me
  4.   plist=[#snd:[#comment:"Audio name",#format:#string,#default:""],\
  5. #list_source:[#comment:"Time list (if used)",#format:#string,#default:""],\
  6. #a1:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  7. #a2:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  8. #a3:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  9. #a4:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  10. #a5:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  11. #a6:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  12. #a7:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  13. #a8:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  14. #a9:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  15. #a10:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  16. #a11:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  17. #a12:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  18. #a13:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  19. #a14:[#comment:"TIME@ACTION",#format:#string,#default:""],\
  20. #a15:[#comment:"TIME@ACTION",#format:#string,#default:""]]
  21.   return plist
  22. end
  23.  
  24. on beginsprite me
  25.   times=[]
  26.   events=[]
  27.   oid=the itemdelimiter
  28.   the itemdelimiter="@"
  29.   if list_source<>"" and list_source<>Void then 
  30.     parse_list(me)
  31.   else
  32.     repeat with i=1 to 15
  33.       grp=symbol("a"&string(i))
  34.       str=me[grp]
  35.       if str<>Void then
  36.         n_time=str.item[1]
  37.         n_action=str.item[2]
  38.         times.add(n_time)
  39.         events.add(n_action)
  40.       end if
  41.     end repeat
  42.   end if
  43.   the itemdelimiter=oid
  44.   next_time=times[1]
  45.   ttime=member(snd).duration
  46.   puppetsound(1,snd)
  47. end
  48.  
  49. on exitframe me
  50.   st=sound(1).elapsedtime
  51.   if st=0 then
  52.     etime=ttime
  53.   else
  54.     etime=sound(1).elapsedtime
  55.   end if
  56.   if etime>=next_time then
  57.     act=events[1]
  58.     do(act)
  59.     deleteat(events,1)
  60.     deleteat(times,1)
  61.     if times.count>0 then
  62.       next_time=times[1]
  63.     else
  64.       next_time=999999999999999
  65.     end if
  66.   end if
  67.   go the frame
  68. end
  69.  
  70. on parse_list me
  71.   str=member(list_source).text
  72.   nl=member(list_source).linecount
  73.   repeat with i=1 to nl
  74.     ntry=str.line[i]
  75.     if ntry.length>3 then
  76.       tim=value(ntry.item[1])
  77.       act=ntry.item[2]
  78.       times.add(tim)
  79.       events.add(act)
  80.     end if
  81.   end repeat
  82. end
  83.  
  84.  
  85.